package com.ruoyi.easyfame.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.easyfame.domain.ExpertSchedule;
import com.ruoyi.easyfame.service.impl.ExpertServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import java.util.List;


@RestController
@RequestMapping("/easyfame/expert")
public class Expert extends BaseController{

    @Autowired
    public ExpertServiceImpl expertServiceImpl;

    @GetMapping("/list")
    public TableDataInfo list()
    {
        System.out.println("list");
        startPage();
        List<SysUser> list = expertServiceImpl.selectExpertList();
        return getDataTable(list);
    }


    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success( expertServiceImpl.selectExpertById(id));
    }
}
